import React from 'react';
import Home from "@/views/home";
import Bookrack from "@/views/bookrack";
import Member from "@/views/member";
import User from "@/views/user";
import NotFound from "@/views/notfound"
import Login from '@/views/login';
import Register from '@/views/register'
import {Switch, Route, NavLink, Redirect} from 'react-router-dom'

function App() {
  return (
    <div className="container">
        <Switch>
        <Route path="/home" component = {Home}/>
        <Route path="/bookrack" component = {Bookrack}/>
        <Route path="/member" component = {Member}/>
        <Route path="/user" component = {User}/>
        <Redirect from="/" exact to="/home"/>
        <Route path="/login" component={ Login }/>
        <Route path="/register" component = { Register }/>
        <Route component = {NotFound}/>
        </Switch>
        <footer className="footer">
            <ul>
                <NavLink to="/home" activeClassName="active">
                    <span className="iconfont icon-1"></span>
                    <p>首页</p>
                </NavLink>
                <NavLink to="/bookrack" activeClassName="active">
                    <span className="iconfont icon-paihang"></span>
                    <p>排行</p>
                </NavLink>
                <NavLink to="/member" activeClassName="active">
                    <span className="iconfont icon-huiyuanqiazhifu"></span>
                    <p>VIP</p>
                </NavLink>
                <NavLink to="/user" activeClassName="active">
                    <span className="iconfont icon-denglu"></span>
                    <p>个人中心</p>
                </NavLink>
            </ul>
        </footer>
    </div>
  );
}

export default App;
